﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace CP2011_Assignment
{
    public partial class Login : Form
    {
        public Login()
        {
            InitializeComponent();
        }

        private void btnLogin_Click(object sender, EventArgs e)
        {
            //validate id and password
            if (txtUsername.Text == "1234" && txtPassword.Text == "1234")
            {
                this.Hide();
                MenuProduction menu = new MenuProduction();
                DialogResult dr = menu.ShowDialog();
                this.Close();
            }
            else if (txtUsername.Text == "123" && txtPassword.Text == "1234")
            {
                this.Hide();
                MenuInventory menu = new MenuInventory();
                DialogResult dr = menu.ShowDialog();
                this.Close();
            }
        }

        private void Login_FormClosed(object sender, FormClosedEventArgs e)
        {
            Application.Exit();
        }

       
    }
}
